package com.qiangesoft.im.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qiangesoft.im.entity.ImMessage;
import com.qiangesoft.im.pojo.bo.ImChatMessageBO;
import com.qiangesoft.im.pojo.dto.ImMessageDTO;
import com.qiangesoft.im.pojo.dto.query.MessageQueryDTO;
import com.qiangesoft.im.pojo.dto.query.PageQueryDTO;
import com.qiangesoft.im.pojo.vo.ImMessageVO;
import com.qiangesoft.im.pojo.vo.PageResultVO;

import java.util.List;

/**
 * <p>
 * 消息 服务类
 * </p>
 *
 * @author qiangesoft
 * @date 2024-02-07
 */
public interface IImMessageService extends IService<ImMessage> {

    /**
     * 消息列表
     *
     * @param pageQuery
     * @param messageQuery
     * @return
     */
    PageResultVO<ImMessageVO> listMessage(PageQueryDTO pageQuery, MessageQueryDTO messageQuery);

    /**
     * 未读消息列表
     *
     * @param chatId
     * @return
     */
    List<ImMessageVO> listUnreadMessage(Long chatId);

    /**
     * 发送消息
     *
     * @param messageDTO
     * @return
     */
    ImMessage send(ImMessageDTO messageDTO);

    /**
     * 聊天未读消息
     *
     * @param userId
     * @param chatIdList
     * @return
     */
    List<ImChatMessageBO> listChatUnreadMessage(Long userId, List<Long> chatIdList);

    /**
     * 聊天最新消息
     *
     * @param userId
     * @param chatIdList
     * @return
     */
    List<ImMessage> listLatestMessage(Long userId, List<Long> chatIdList);
}
